package com.chx.three.mama.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.ListView;

import com.chx.three.mama.R;
import com.chx.three.mama.model.RingBBS;

import java.util.List;

/**
 * 圈子帖子置顶的listView适配器
 */
public class BbsTopAdapter extends BaseAdapter{
    private  Context mContext;
    private List<RingBBS> data;
    public BbsTopAdapter(Context context,List<RingBBS> data){
        this.mContext=context;
        this.data=data;
    }
    @Override
    public int getCount() {
        if(data!=null){
            return data.size();
        }
        return 0;
    }

    @Override
    public Object getItem(int position) {
        if(data!=null){
            return data.get(position);
        }
        return null;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view=null;
        if(convertView!=null){
            view=convertView;
        }else{
            view= LayoutInflater.from(mContext).inflate(R.layout.item_ring_bbs_top,parent,false);
        }

        return view;
    }
    private class ViewHolder{

    }
}
